# import time
from jinja2 import Template

# def home():
#
#
#     with open('05dong.html', 'rb') as f:
#         data = f.read()
#     return data
    # conn.send(data)

    # conn.close()

def home(conn):

    # {% for i in hobby %}
    # <li>{{ i }}</li>
    # {% endfor %}

    with open('08jinja2test.html', 'r',encoding='utf-8') as f:
        data = f.read()
    t = Template(data)
    ret = t.render({'hobby':['金钱','女人','金鑫']})
    conn.send(ret.encode('utf-8'))
    conn.close()
    # return ret

def person_center(conn):
    with open('06center.html', 'rb') as f:
        data = f.read()

    conn.send(data)

    conn.close()

    # return data
# def css(conn):
#     with open('style.css', 'rb') as f:
#         data = f.read()
#     conn.send(data)
# #
#     conn.close()
# def js(conn):
#     with open('test.js', 'rb') as f:
#         data = f.read()
#     conn.send(data)
#
#     conn.close()
# def pic(conn):
#     with open('1.jpg', 'rb') as f:
#         data = f.read()
#     conn.send(data)
#
#     conn.close()
#
# # def nofount(conn):
# #     conn.send(b'not found 404!')
# #
# #     conn.close()
#
# def ico(conn):
#     with open('favicon.ico', 'rb') as f:
#         data = f.read()
#     conn.send(data)
#
#     conn.close()
